package com.integral.service;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.integral.dao.IBankExchangeRateDao;
import com.integral.entity.BankExchangeRate;
import com.integral.vo.BankExchangeRateVo;

/**
 * @Description: 银行汇率表Service类
 * @author zhaofan
 * @date 2018年05月08日 上午01:21:46
 */
@Service("bankExchangeRateService")
public class BankExchangeRateService {
	
	/**
	 * 注入银行汇率表Dao
	 */
	@Resource
	private IBankExchangeRateDao bankExchangeRateDao;
	
	/**
	 * @Description: 新增银行汇率表
	 * @param bankExchangeRate 银行汇率表
	 * @return 受影响行数
	 * @author zhaofan
	 * @date 2018年05月08日 上午01:21:46
	 */
	public int addBankExchangeRate(BankExchangeRate bankExchangeRate) {
		bankExchangeRate.setCreateEmp("SYS");
		bankExchangeRate.setCreateTime(new Date());
		bankExchangeRate.setDeleteFlag(0);
		return bankExchangeRateDao.addBankExchangeRate(bankExchangeRate);
	}
	
	/**
	 * @Description: 修改银行汇率表
	 * @param bankExchangeRate 银行汇率表
	 * @return 受影响行数
	 * @author zhaofan
	 * @date 2018年05月08日 上午01:21:46
	 */
	public int updateById(BankExchangeRate bankExchangeRate) {
		return bankExchangeRateDao.updateById(bankExchangeRate);
	}
	
	/**
	 * @Description: 删除银行汇率表
	 * @param id 主键
	 * @return 受影响行数
	 * @author zhaofan
	 * @date 2018年05月08日 上午01:21:46
	 */
	public int deleteById(Long id) {
		return bankExchangeRateDao.deleteById(id);
	}
	
	/**
	 * @Description: 根据ID查询银行汇率表
	 * @param id 主键
	 * @return 银行汇率表
	 * @author zhaofan
	 * @date 2018年05月08日 上午01:21:46
	 */
	public BankExchangeRate findByBankExchangeRate(BankExchangeRateVo bankExchangeRateVo) {
		return bankExchangeRateDao.findByBankExchangeRate(bankExchangeRateVo);
	}
	
	/**
	 * 查询银行汇率信息总记录数
	 * @param bankExchangeRateVo
	 * @return
	 */
	public Long findBankExchangeRateCount(BankExchangeRateVo bankExchangeRateVo){
		return bankExchangeRateDao.findBankExchangeRateCount( bankExchangeRateVo);
	}
	
	/**
	 * 查询银行汇率信息
	 * @param bankExchangeRateVo
	 * @return
	 */
	public List<BankExchangeRateVo> findBankExchangeRate(BankExchangeRateVo bankExchangeRateVo){
		return bankExchangeRateDao.findBankExchangeRate( bankExchangeRateVo);
	}
	
}